<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<link href="css/adminstyle.css" rel="stylesheet" type="text/css">
<title>管理区域</title>
<script src="js/js.js"></script>
<script  language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script>
function delc(id){
	if(confirm('确认要删除此栏目，将删除所属子栏目及信息'))	{
		self.location.href='employees_delete.html?id='+id;
	}
}
function submits1(action){
		var check_flg = false;
		$("input:checkbox[name='id[]']:checked").each(function(){
	            check_flg = true; 
	    })

        if(check_flg==true){
			document.getElementById('form').action=action;
			document.getElementById('form').submit();
        }else{
			alert('请选中相应的人员进行操作');        	
        }
}
</script>
</head>

<body>
<div id="man_zone">
<div style="background-color:#FFFFFF ">
<div class="search_condition">
<div style="margin-top:10px;margin-bottom:10px;">
<form name="theForm">
&nbsp;&nbsp;&nbsp;&nbsp;
号码<input name="number" type="text" value="<?=getParamValue('number','')?>" id="number"/>
产品&nbsp;&nbsp;<select name="product_id" id="select" id="product_id">
	<option value="">选择</option>
	<?=$productOption?>
	</select>
<input name="start_number" type="text" value="<?=getParamValue('start_number','')?>" id="start_number"/>
至<input name="end_number" type="text" value="<?=getParamValue('end_number','')?>" id="end_number"/>
 激活状态<select name="status" id="status">
<option value="">选择</option>
<?=$statusOption?>
</select>
发放状态
<select name="ticket_send_type" id="ticket_send_type">
<option value="">选择</option>
<?=$ticketSendTypeOption?>
</select>
使用状态<select name="ticket_used_type"  id="ticket_used_type">
<option value="">选择</option>
<?=$ticketUsedTypeOption?>
</select>
  <input class="PublicBot"  name="" type="button" value="检索"  onClick ="javaScript:formSubmit2();"  />
  <input class="PublicBot"  name="" type="button" value="生成号码券" onClick="javaScript:location.href='ticket_generate.html'"/>
  <input class="PublicBot"  name="" type="button" value="导出号码券" onClick ="javaScript:formSubmit();"  />
</form>
</div>
</div>
<br>
<form method="get" id="form" >
  <table width="98%" border="0" align="center"  cellpadding="3" cellspacing="1" class="tableborder">
    <tr class="header">
    <td width="5%"></td>
      <td  width="15%">商品</td>
      <td  width="15%">号码</td>
      <td  width="15%">有效期</td>
      <td  width="10%">发放信息</td>
      <td  width="10%">接受人</td>
      <td  width="10%">使用信息</td>
      <td width="10%">激活信息</td>
	  <td width="10%">状态</td>
    </tr>
    <?
    foreach($list as $v){
	?>
    <tr  style="background-color:#FFFFFF ">
      <td align="center"><input type="checkbox" name="id[]" id="checkbox" value="<?=$v['id']?>"></td>
      <td ><?=$v['product_name']?></td>
      <td ><?=$v['number']?></td>
      <td ><?=date('Y-m-d',$v['valid_start_time'])?>至<?=date('Y-m-d',$v['valid_end_time'])?></td>
      <td ><?if($v['send_time']==0){?>未发放<?}else{?><?=$v['send_admin']?>&nbsp;&nbsp;&nbsp;<?=date('Y-m-d H:i:s',$v['send_time'])?><?}?></td>
      <td ><?if($v['receive_user_id']){?><a href=""><?=$v['receive_email']?></a><?}?></td>
      <td ><?if($v['use_time']==0){?>未使用<?}else{?><a href=""><?=$v['use_user']?>&nbsp;&nbsp;&nbsp;<?=date('Y-m-d H:i:s',$v['use_time'])?></a><?}?></td>
      <td ><?if($v['activation_time']==0){?>未激活<?}else{?><?=$v['activation_admin']?>&nbsp;&nbsp;<?=date('Y-m-d H:i:s',$v['activation_time'])?><?}?></td>
	  <td ><?=$v['status']?></td>
    </tr> 
    <?
	}
	?>
 <tr  style="background-color:#FFFFFF ">
 <td align="center"><input type="checkbox" name="chkall" id="checkbox"  onClick="CheckAll(this.form)"></td>
 <td colspan="8"> <input type="button" class="PublicBot" name="delete" id="button" value="激活" onClick="submits1('Ticket_activation.html')">
 <input type="button" class="PublicBot" name="delete" id="button" value="注销" onClick="submits1('Ticket_cancellation.html')">
 <?  echo $page; ?>
 </td>
 </tr>
  </table>
 </form>
</div>
</div>
<script>
  function formSubmit() {
  	var product_id= $("#product_id").val();
  	var number= $("#number").val();
  	var start_number= $("#start_number").val();
  	var end_number= $("#end_number").val();
  	var status= $("#status").val();
  	var ticket_send_type = $("#ticket_send_type").val();
  	var ticket_used_type = $("#ticket_used_type").val();
    var url='ticket_export.html?product_id='+product_id+'&start_number='+start_number+'&end_number='+end_number+'&number='+number+'&status='+status+'&ticket_send_type='+ticket_send_type+'&ticket_used_type='+ticket_used_type
    document.forms['theForm'].method = 'post';
    document.forms['theForm'].action = url;
    document.forms['theForm'].submit();  
 }
  function formSubmit2() {
    document.forms['theForm'].method = 'get';
    document.forms['theForm'].action = 'ticket_lists.html';
    document.forms['theForm'].submit();  
 }
</script>
</body>
</html>
